using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_JobsUnderWorkMap : EntityTypeConfiguration<so_JobsUnderWork>
    {
        public so_JobsUnderWorkMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Job_Number)
                .HasMaxLength(20);

            this.Property(t => t.Customer__)
                .HasMaxLength(6);

            this.Property(t => t.Company)
                .HasMaxLength(110);

            this.Property(t => t.Tool_Type)
                .HasMaxLength(10);

            this.Property(t => t.Tool_Serial)
                .HasMaxLength(20);

            this.Property(t => t.Old_Tool__)
                .HasMaxLength(20);

            this.Property(t => t.Repair_Type)
                .HasMaxLength(50);

            this.Property(t => t.Damage_Kind)
                .HasMaxLength(50);

            this.Property(t => t.Repaired)
                .HasMaxLength(10);

            this.Property(t => t.First_Mechanic)
                .HasMaxLength(50);

            this.Property(t => t.Second_Mechanic)
                .HasMaxLength(50);

            this.Property(t => t.Delivery_Address)
                .HasMaxLength(50);

            this.Property(t => t.Billing_Address)
                .HasMaxLength(50);

            this.Property(t => t.Invoice_Cycle)
                .HasMaxLength(10);

            this.Property(t => t.Delivery_Cycle)
                .HasMaxLength(10);

            this.Property(t => t.Quotation_Cycle)
                .HasMaxLength(10);

            this.Property(t => t.Repair_Cycle)
                .HasMaxLength(10);

            this.Property(t => t.Total_Repair_Cycle)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("so_JobsUnderWork");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Job_Number).HasColumnName("Job_Number");
            this.Property(t => t.Customer__).HasColumnName("Customer_#");
            this.Property(t => t.Company).HasColumnName("Company");
            this.Property(t => t.Request_Date).HasColumnName("Request_Date");
            this.Property(t => t.Purchase_Date).HasColumnName("Purchase_Date");
            this.Property(t => t.Tool_Type).HasColumnName("Tool_Type");
            this.Property(t => t.Tool_Serial).HasColumnName("Tool_Serial");
            this.Property(t => t.Old_Tool__).HasColumnName("Old_Tool_#");
            this.Property(t => t.Repair_Type).HasColumnName("Repair_Type");
            this.Property(t => t.Damage_Kind).HasColumnName("Damage_Kind");
            this.Property(t => t.Repaired).HasColumnName("Repaired");
            this.Property(t => t.Customer_Informed_Date).HasColumnName("Customer_Informed_Date");
            this.Property(t => t.Delivered).HasColumnName("Delivered");
            this.Property(t => t.Quotation_Proposed).HasColumnName("Quotation_Proposed");
            this.Property(t => t.Customer_Approval).HasColumnName("Customer_Approval");
            this.Property(t => t.First_Mechanic).HasColumnName("First_Mechanic");
            this.Property(t => t.Second_Mechanic).HasColumnName("Second_Mechanic");
            this.Property(t => t.Top_Stop_Approval).HasColumnName("Top_Stop_Approval");
            this.Property(t => t.Approval_Date).HasColumnName("Approval_Date");
            this.Property(t => t.Warranty_Approved).HasColumnName("Warranty_Approved");
            this.Property(t => t.Note).HasColumnName("Note");
            this.Property(t => t.Quotation_Date).HasColumnName("Quotation_Date");
            this.Property(t => t.Tool_In_Date).HasColumnName("Tool_In_Date");
            this.Property(t => t.Tool_Out_Date).HasColumnName("Tool_Out_Date");
            this.Property(t => t.Assembling_Time).HasColumnName("Assembling_Time");
            this.Property(t => t.DisAssembling_Time).HasColumnName("DisAssembling_Time");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Delivery_Date).HasColumnName("Delivery_Date");
            this.Property(t => t.Delivery_Address).HasColumnName("Delivery_Address");
            this.Property(t => t.Billing_Address).HasColumnName("Billing_Address");
            this.Property(t => t.Invoice_Cycle).HasColumnName("Invoice_Cycle");
            this.Property(t => t.Delivery_Cycle).HasColumnName("Delivery_Cycle");
            this.Property(t => t.Quotation_Cycle).HasColumnName("Quotation_Cycle");
            this.Property(t => t.Repair_Cycle).HasColumnName("Repair_Cycle");
            this.Property(t => t.Total_Repair_Cycle).HasColumnName("Total_Repair_Cycle");
        }
    }
}
